﻿//===========================[ 8 / 1 / 2011 LVI ]=============================
//				Copyright c Vitaly Lyaschenko <SkyChameleon@gmail.com>
// 								Header file
// Purpose: 
//=============================================================================
#pragma once

#include "IFile.h"
#include "common.h"


class cFile /*: public IFile*/
{
	bool state;
	std::fstream m_File;
	modeFile m_mode;
	void open_fileAsText( const std::string & );
	void open_fileAsBinary( const std::string & );

public:
	cFile() { }
	cFile( const std::string &, const typeFile, const modeFile );
	~cFile();

	void open_file( const std::string &, const typeFile, const modeFile );

	void readFile( void *data,size_t numBytes );
	void writeToFile( void *data,size_t numBytes );

	void seek( size_t numBytes );
	void seekTo( size_t offset );
	long getSize();
	long getPosition();

	bool getStateOK() const { return state; }
};